
-- This test files will check for scripting of partition functions, partition schemes,
-- partitioned tables and partitioned indexes.

-----------------------------------------------------
--- Partition Function with All supported datatypes
-----------------------------------------------------
-- all datatypes should sort and store the values in ascending order by itself
-- and input values should be implicit casted into specified type

-- using local variable in args
CREATE PARTITION FUNCTION IntPartitionFunction (int) 
AS RANGE RIGHT FOR VALUES (0, 1000, 500);
GO


-- explicit schema can also be specified with paramater type
CREATE PARTITION FUNCTION BigIntPartitionFunction (sys.bigint)
AS RANGE RIGHT FOR VALUES (0, 10000, 100, 1000);
GO

CREATE PARTITION FUNCTION SmallIntPartitionFunction (smallint) 
AS RANGE RIGHT FOR VALUES (cast(32767 as bigint), -32768, 0);
GO

-- explicit schema can also be specified with paramater type
CREATE PARTITION FUNCTION TinyIntPartitionFunction (sys.tinyint)
AS RANGE RIGHT FOR VALUES (0, cast(255 as varchar), 128);
GO

CREATE PARTITION FUNCTION DecimalPartitionFunction (decimal(10, 5))
AS RANGE RIGHT FOR VALUES (0.0, 300.0, 200.0, 100.0);
GO

CREATE PARTITION FUNCTION NumericPartitionFunction (numeric(5, 2))
AS RANGE RIGHT FOR VALUES (0.0, 30.0, 10.0, 20.0);
GO

CREATE PARTITION FUNCTION MoneyPartitionFunction (MONEY)
AS RANGE RIGHT FOR VALUES ($2.56789, ¥4.91, $3.56789);
GO

CREATE PARTITION FUNCTION SmallMoneyPartitionFunction (SMALLMONEY)
AS RANGE RIGHT FOR VALUES ($2.56789, ¥4.91, $3.56789);
GO

CREATE PARTITION FUNCTION DatePartitionFunction (date) 
AS RANGE RIGHT FOR VALUES ('2022-07-01', '2022-01-01','2023-01-01');
GO

-- should implicity cast it to input type
CREATE PARTITION FUNCTION DateTimePartitionFunction (datetime)
AS RANGE RIGHT FOR VALUES ('2022-01-01', '2022-07-01 00:00:00', '2019-01-01 00:00:00');
GO

CREATE PARTITION FUNCTION DateTime2PartitionFunction (datetime2(3))
AS RANGE RIGHT FOR VALUES ('2022-01-01 00:00:00.000', '2022-07-01 00:00:00.000', '2019-01-01 00:00:00.000');
GO

CREATE PARTITION FUNCTION SmallDateTimePartitionFunction (smalldatetime)
AS RANGE RIGHT FOR VALUES ('2022-01-01', '2022-07-01', '2019-01-01');
GO

CREATE PARTITION FUNCTION CharPartitionFunction (char(5))
AS RANGE RIGHT FOR VALUES ('A', 'F', 'K', 'P', 'U', 'Z', 'D');
GO

CREATE PARTITION FUNCTION VarCharPartitionFunction (varchar(10))
AS RANGE RIGHT FOR VALUES ('Apple', 'Banana', 'Mango', 'Cherry', 'Date');
GO

CREATE PARTITION FUNCTION NVarCharPartitionFunction (nvarchar(10))
AS RANGE RIGHT FOR VALUES (N'Apple', N'Banana', N'Mango', N'Cherry', N'Date');
GO

CREATE PARTITION FUNCTION NCharPartitionFunction (nchar(5))
AS RANGE RIGHT FOR VALUES (N'A', N'F', N'K', N'P', N'U', N'Z', N'B');
GO

CREATE PARTITION FUNCTION BinaryPartitionFunction (binary(4))
AS RANGE RIGHT FOR VALUES (0x000, 0x800, 0x400, 0xC000);
GO

CREATE PARTITION FUNCTION VarBinaryPartitionFunction (varbinary(8))
AS RANGE RIGHT FOR VALUES (0x0000000000000000, 0x8000000000000000, 0x4000000000000000, 0xC000000000000000);
GO

CREATE PARTITION FUNCTION UniqueIdentifierPartitionFunction (uniqueidentifier)
AS RANGE RIGHT FOR VALUES ('00000000-0000-0000-0000-000000000000', 'FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF', '6F9619FF-8B86-D011-B42D-00C04FC964FF');
GO

-- identifier length greater than 64
CREATE PARTITION FUNCTION PartitionFunctionNameGreaterThan64AndLessThan128abcdefghijklmnopqrstuvwxyz (bigint)
AS RANGE RIGHT FOR VALUES (0, 10000, 100, 1000);
GO

CREATE PARTITION FUNCTION PartitionFunctionNameGreaterThan64AndLessThan128HavingEmoji😎$123🌍rder (bigint)
AS RANGE RIGHT FOR VALUES (0, 10000, 100, 1000);
GO

CREATE PARTITION FUNCTION PartitionFunctionHavingDifferentCollationInput (NVARCHAR(50))
AS RANGE RIGHT
FOR VALUES (
    N'John Doe',
    N'Jane Smith' COLLATE Latin1_General_CI_AS,
    N'châu phố' COLLATE Vietnamese_CI_AS,
    N'Müller GmbH' COLLATE Traditional_Spanish_CI_AS
);
GO

--------------------------------------------------
--- Partition Scheme
--------------------------------------------------

-- without all option
-- filegroups are equal to partition that will generated by function
CREATE PARTITION SCHEME IntPartitionScheme AS
PARTITION IntPartitionFunction 
TO ([PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY]);
GO

-- filgroups are more than partition that will generated by function
CREATE PARTITION SCHEME BigIntPartitionScheme AS
PARTITION BigIntPartitionFunction 
TO ([PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY]);
GO

-- with all option
CREATE PARTITION SCHEME SmallIntPartitionScheme AS
PARTITION SmallIntPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME TinyIntPartitionScheme AS
PARTITION TinyIntPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME DecimalPartitionScheme AS
PARTITION DecimalPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME NumericPartitionScheme AS
PARTITION NumericPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME MoneyPartitionScheme AS
PARTITION MoneyPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME SmallMoneyPartitionScheme AS
PARTITION SmallMoneyPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME DatePartitionScheme AS
PARTITION DatePartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME DateTimePartitionScheme AS
PARTITION DateTimePartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME DateTime2PartitionScheme AS
PARTITION DateTime2PartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME SmallDateTimePartitionScheme AS
PARTITION SmallDateTimePartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME CharPartitionScheme AS
PARTITION CharPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME VarCharPartitionScheme AS
PARTITION VarCharPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME NVarCharPartitionScheme AS
PARTITION NVarCharPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME NCharPartitionScheme AS
PARTITION NCharPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME BinaryPartitionScheme AS
PARTITION BinaryPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME VarBinaryPartitionScheme AS
PARTITION VarBinaryPartitionFunction 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME UniqueIdentifierPartitionScheme AS
PARTITION UniqueIdentifierPartitionFunction 
ALL TO ([PRIMARY]);
GO

-- identifier length greater than 64
CREATE PARTITION SCHEME PartitionSchemeNameGreaterThan64AndLessThan128abcdefghijklmnopqrstuvwxyz AS
PARTITION PartitionFunctionNameGreaterThan64AndLessThan128abcdefghijklmnopqrstuvwxyz 
ALL TO ([PRIMARY]);
GO

CREATE PARTITION SCHEME PartitionSchemeNameGreaterThan64AndLessThan128HavingEmoji😎$123🌍rder AS
PARTITION PartitionFunctionNameGreaterThan64AndLessThan128HavingEmoji😎$123🌍rder
ALL TO ([PRIMARY]);
GO

CREATE SCHEMA PartitionSchemaNameGreaterThan64abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
GO

CREATE TABLE PartitionSchemaNameGreaterThan64abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.PartitionTableNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz (
    PartitionColumnNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz BIGINT,
    Value sys.varchar(50)
) ON   PartitionSchemeNameGreaterThan64AndLessThan128abcdefghijklmnopqrstuvwxyz    (PartitionColumnNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz);
GO

CREATE INDEX PartitionIndexNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz
ON PartitionSchemaNameGreaterThan64abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.PartitionTableNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz(Value)
ON PartitionSchemeNameGreaterThan64AndLessThan128abcdefghijklmnopqrstuvwxyz
(PartitionColumnNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz);
GO

CREATE TABLE PartitionSchemaNameGreaterThan64abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.PartitionTableNameGreaterThan64AndLessThan128HavingEmoji😎$123🌍rder (
    PartitionColumnNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz BIGINT,
    Value sys.varchar(50)
) ON PartitionSchemeNameGreaterThan64AndLessThan128HavingEmoji😎$123🌍rder   
(PartitionColumnNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz);
GO

CREATE INDEX PartitionIndexNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz
ON PartitionSchemaNameGreaterThan64abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.PartitionTableNameGreaterThan64AndLessThan128HavingEmoji😎$123🌍rder(Value)
ON PartitionSchemeNameGreaterThan64AndLessThan128HavingEmoji😎$123🌍rder 
(PartitionColumnNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz);
GO

--------------------------------------------------
--- name identifiers test
--------------------------------------------------
CREATE PARTITION FUNCTION PARTITION_FUNCTIONログインαιώνια (int)
AS RANGE RIGHT FOR VALUES (0, 500, 1000);
GO

CREATE PARTITION SCHEME PARTITION_SCHEMEログインαιώνια AS
PARTITION PARTITION_FUNCTIONログインαιώνια
ALL TO ([PRIMARY]);
GO

CREATE PARTITION FUNCTION [PARTITION_FUNCTION  유니코드스키마👻  ] (int)
AS RANGE RIGHT FOR VALUES (0, 500, 1000);
GO

CREATE PARTITION SCHEME [PARTITION_SCHEME  유니코드스키마👻  ] AS
PARTITION [PARTITION_FUNCTION  유니코드스키마👻  ]
ALL TO ([PRIMARY]);
GO

CREATE TABLE [PARTITION_TABLE  유니코드스키마👻  ](
    [PARTITION_COLUMN  유니코드스키마👻  ] INT,
    Value sys.varchar(50)
) ON [PARTITION_SCHEME  유니코드스키마👻  ]([PARTITION_COLUMN  유니코드스키마👻  ]);
GO

CREATE INDEX [PARTITION_INDEX 유니코드스키마👻  ]
ON [PARTITION_TABLE  유니코드스키마👻  ](Value)
ON [PARTITION_SCHEME  유니코드스키마👻  ]([PARTITION_COLUMN  유니코드스키마👻  ]);
GO

-- qouted identifer
SET QUOTED_IDENTIFIER ON;
GO

CREATE PARTITION FUNCTION "PARTITION_FUNCTION 😎$@ #123 🌍rder  " (int)
AS RANGE RIGHT FOR VALUES (0, 500, 1000);
GO

CREATE PARTITION SCHEME "PARTITION_SCHEME 😎$@ #123 🌍rder  " AS
PARTITION "PARTITION_FUNCTION 😎$@ #123 🌍rder  "
ALL TO ([PRIMARY]);
GO


CREATE TABLE "PARTITION_TABLE 😎$@ #123 🌍rder  " (
    "PARTITION_COLUMN 😎$@ #123 🌍rder  " INT,
    Value sys.varchar(50)
) ON "PARTITION_SCHEME 😎$@ #123 🌍rder  " ("PARTITION_COLUMN 😎$@ #123 🌍rder  ");
GO

CREATE INDEX "PARTITION_INDEX 😎$@ #123 🌍rder  "
ON "PARTITION_TABLE 😎$@ #123 🌍rder  " (Value)
ON "PARTITION_SCHEME 😎$@ #123 🌍rder  "("PARTITION_COLUMN 😎$@ #123 🌍rder  ");
GO

SET QUOTED_IDENTIFIER OFF;
Go


---------------------------------------------------------------------------
--- CREATE PARTITIONED TABLES with PARTITION SCHEME for different datatypes
---------------------------------------------------------------------------
-- int data type
CREATE TABLE partition_vu_prepare_int_table (
    Id INT UNIQUE,
    Value sys.varchar(50)
) ON IntPartitionScheme(Id);
GO

-- add constraint
ALTER TABLE partition_vu_prepare_int_table ADD CONSTRAINT check_value_not_null CHECK(value IS NOT NULL);
GO

-- bigint data type
CREATE TABLE partition_vu_prepare_bigint_table (
    Id BIGINT,
    Value sys.varchar(50)
) ON BigIntPartitionScheme--this is comment should get ignored
(Id);
GO

-- smallint data type
CREATE TABLE partition_vu_prepare_smallint_table (
    Id SMALLINT,
    Value sys.varchar(50)
) ON SmallIntPartitionScheme(Id);
GO

-- tinyint data type
CREATE TABLE partition_vu_prepare_tinyint_table (
    Id TINYINT,
    Value sys.varchar(50)
) ON TinyIntPartitionScheme(Id);
GO

-- decimal data type
CREATE TABLE partition_vu_prepare_decimal_table (
    Id DECIMAL(10, 5),
    Value sys.varchar(50)
) ON DecimalPartitionScheme(Id);
GO

-- numeric data type
CREATE TABLE partition_vu_prepare_numeric_table (
    Id NUMERIC(5, 2),
    Value sys.varchar(50)
) ON NumericPartitionScheme(Id);
GO

-- money data type
CREATE TABLE partition_vu_prepare_money_table (
    Id MONEY,
    Value sys.varchar(50)
) ON MoneyPartitionScheme(Id);
GO

-- smallmoney data type
CREATE TABLE partition_vu_prepare_smallmoney_table (
    Id SMALLMONEY,
    Value sys.varchar(50)
) ON SmallMoneyPartitionScheme(Id);
GO

-- date data type
CREATE TABLE partition_vu_prepare_date_table (
    Id DATE,
    Value sys.varchar(50)
) ON DatePartitionScheme(Id);
GO

-- datetime data type
CREATE TABLE partition_vu_prepare_datetime_table (
    Id DATETIME,
    Value sys.varchar(50)
) ON DateTimePartitionScheme(Id);
GO

-- datetime2 data type
CREATE TABLE partition_vu_prepare_datetime2_table (
    Id DATETIME2(3),
    Value sys.varchar(50)
) ON DateTime2PartitionScheme(Id);
GO

-- smalldatetime data type
CREATE TABLE partition_vu_prepare_smalldatetime_table (
    Id SMALLDATETIME,
    Value sys.varchar(50)
) ON SmallDateTimePartitionScheme(Id);
GO

-- char data type
CREATE TABLE partition_vu_prepare_char_table (
    Id CHAR(5),
    Value sys.varchar(50)
) ON CharPartitionScheme(Id);
GO

-- varchar data type
CREATE TABLE partition_vu_prepare_varchar_table (
    Id VARCHAR(10),
    Value sys.varchar(50)
) ON VarCharPartitionScheme(Id);
GO

-- nvarchar data type
CREATE TABLE partition_vu_prepare_nvarchar_table (
    Id NVARCHAR(10),
    Value sys.varchar(50)
) ON NVarCharPartitionScheme(Id);
GO

-- nchar data type
CREATE TABLE partition_vu_prepare_nchar_table (
    Id NCHAR(5),
    Value sys.varchar(50)
) ON NCharPartitionScheme(Id);
GO

-- binary data type
CREATE TABLE partition_vu_prepare_binary_table (
    Id BINARY(4),
    Value sys.varchar(50)
) ON BinaryPartitionScheme(Id);
GO

-- varbinary data type
CREATE TABLE partition_vu_prepare_varbinary_table (
    Id VARBINARY(8),
    Value sys.varchar(50)
) ON VarBinaryPartitionScheme(Id);
GO

-- uniqueidentifier data type
CREATE TABLE partition_vu_prepare_uniqueidentifier_table (
    Id UNIQUEIDENTIFIER,
    Value sys.varchar(50)
) ON UniqueIdentifierPartitionScheme(Id);
GO

-- identifier length greater than 64
CREATE TABLE PartitionTableNameGreaterThan64AndLessThan128abcdefghijklmnopqrstuvwxyz (
    Id INT,
    Value sys.varchar(50)
) ON IntPartitionScheme(Id);
GO

---------------------------------------------------------------------------
--- CREATE ALIGNED PARTITIONED INDEX with PARTITION SCHEME
---------------------------------------------------------------------------
-- using schema name
CREATE INDEX partition_vu_prepare_int_index
ON dbo.partition_vu_prepare_int_table(Value)
ON IntPartitionScheme (Id);
GO

-- without explicit schema name
CREATE INDEX partition_vu_prepare_bigint_index
ON partition_vu_prepare_bigint_table(Id)
ON BigIntPartitionScheme (Id);
GO

-- without partition scheme should also work
CREATE INDEX partition_vu_prepare_smallint_index
ON partition_vu_prepare_smallint_table--this is comment should get ignored
(Id)
GO

CREATE INDEX partition_vu_prepare_tinyint_index
ON partition_vu_prepare_tinyint_table(Id)
ON TinyIntPartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_decimal_index
ON partition_vu_prepare_decimal_table(Id)
ON DecimalPartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_numeric_index
ON partition_vu_prepare_numeric_table(Id)
ON NumericPartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_money_index
ON partition_vu_prepare_money_table(Id)
ON MoneyPartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_smallmoney_index
ON partition_vu_prepare_smallmoney_table(Id)
ON SmallMoneyPartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_date_index
ON partition_vu_prepare_date_table(Id)
ON DatePartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_datetime_index
ON partition_vu_prepare_datetime_table(Id)
ON DateTimePartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_datetime2_index
ON partition_vu_prepare_datetime2_table(Id)
ON DateTime2PartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_smalldatetime_index
ON partition_vu_prepare_smalldatetime_table(Id)
ON SmallDateTimePartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_char_index
ON partition_vu_prepare_char_table(Id)
ON CharPartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_varchar_index
ON partition_vu_prepare_varchar_table(Id)
ON VarCharPartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_nvarchar_index
ON partition_vu_prepare_nvarchar_table(Id)
ON NVarCharPartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_nchar_index
ON partition_vu_prepare_nchar_table(Id)
ON NCharPartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_binary_index
ON partition_vu_prepare_binary_table(Id)
ON BinaryPartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_varbinary_index
ON partition_vu_prepare_varbinary_table(Id)
ON VarBinaryPartitionScheme (Id);
GO

CREATE INDEX partition_vu_prepare_uniqueidentifier_index
ON partition_vu_prepare_uniqueidentifier_table(Id)
ON UniqueIdentifierPartitionScheme (Id);
GO
ddlexport#!#0
GO
--------------------------------------------------
--- DROP Partitioned Index
--------------------------------------------------


DROP INDEX partition_vu_prepare_uniqueidentifier_index ON partition_vu_prepare_uniqueidentifier_table;
GO

DROP INDEX partition_vu_prepare_varbinary_index ON partition_vu_prepare_varbinary_table;
GO

DROP INDEX partition_vu_prepare_binary_index ON partition_vu_prepare_binary_table;
GO

DROP INDEX partition_vu_prepare_nchar_index ON partition_vu_prepare_nchar_table;
GO

DROP INDEX partition_vu_prepare_nvarchar_index ON partition_vu_prepare_nvarchar_table;
GO

DROP INDEX partition_vu_prepare_varchar_index ON partition_vu_prepare_varchar_table;
GO

DROP INDEX partition_vu_prepare_char_index ON partition_vu_prepare_char_table;
GO

DROP INDEX partition_vu_prepare_smalldatetime_index ON partition_vu_prepare_smalldatetime_table;
GO

DROP INDEX partition_vu_prepare_datetime2_index ON partition_vu_prepare_datetime2_table;
GO

DROP INDEX partition_vu_prepare_datetime_index ON partition_vu_prepare_datetime_table;
GO

DROP INDEX partition_vu_prepare_date_index ON partition_vu_prepare_date_table;
GO

DROP INDEX partition_vu_prepare_smallmoney_index ON partition_vu_prepare_smallmoney_table;
GO

DROP INDEX partition_vu_prepare_money_index ON partition_vu_prepare_money_table;
GO

DROP INDEX partition_vu_prepare_numeric_index ON partition_vu_prepare_numeric_table;
GO

DROP INDEX partition_vu_prepare_decimal_index ON partition_vu_prepare_decimal_table;
GO

DROP INDEX partition_vu_prepare_tinyint_index ON partition_vu_prepare_tinyint_table;
GO

DROP INDEX partition_vu_prepare_smallint_index ON partition_vu_prepare_smallint_table;
GO

DROP INDEX partition_vu_prepare_bigint_index ON partition_vu_prepare_bigint_table;
GO

DROP INDEX partition_vu_prepare_int_index ON partition_vu_prepare_int_table;
GO

DROP INDEX [PARTITION_INDEX 유니코드스키마👻  ] ON [PARTITION_TABLE  유니코드스키마👻  ]
GO

SET QUOTED_IDENTIFIER ON;
GO

DROP INDEX "PARTITION_INDEX 😎$@ #123 🌍rder  " ON "PARTITION_TABLE 😎$@ #123 🌍rder  "
GO

SET QUOTED_IDENTIFIER OFF;
GO

DROP INDEX PartitionIndexNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz
ON PartitionSchemaNameGreaterThan64abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.PartitionTableNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz
GO

DROP INDEX PartitionIndexNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz
ON PartitionSchemaNameGreaterThan64abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.PartitionTableNameGreaterThan64AndLessThan128HavingEmoji😎$123🌍rder
GO
--------------------------------------------------
--- DROP Partitioned Table
--------------------------------------------------

DROP TABLE partition_vu_prepare_uniqueidentifier_table;
GO

DROP TABLE partition_vu_prepare_varbinary_table;
GO

DROP TABLE partition_vu_prepare_binary_table;
GO

DROP TABLE partition_vu_prepare_nchar_table;
GO

DROP TABLE partition_vu_prepare_nvarchar_table;
GO

DROP TABLE partition_vu_prepare_varchar_table;
GO

DROP TABLE partition_vu_prepare_char_table;
GO

DROP TABLE partition_vu_prepare_smalldatetime_table;
GO

DROP TABLE partition_vu_prepare_datetime2_table;
GO

DROP TABLE partition_vu_prepare_datetime_table;
GO

DROP TABLE partition_vu_prepare_date_table;
GO

DROP TABLE partition_vu_prepare_smallmoney_table;
GO

DROP TABLE partition_vu_prepare_money_table;
GO

DROP TABLE partition_vu_prepare_numeric_table;
GO

DROP TABLE partition_vu_prepare_decimal_table;
GO

DROP TABLE partition_vu_prepare_tinyint_table;
GO

DROP TABLE partition_vu_prepare_smallint_table;
GO

DROP TABLE partition_vu_prepare_bigint_table;
GO

DROP TABLE partition_vu_prepare_int_table;
GO

DROP TABLE PartitionTableNameGreaterThan64AndLessThan128abcdefghijklmnopqrstuvwxyz
GO


DROP TABLE [PARTITION_TABLE  유니코드스키마👻  ]
GO

SET QUOTED_IDENTIFIER ON;
GO

DROP TABLE "PARTITION_TABLE 😎$@ #123 🌍rder  "
GO

SET QUOTED_IDENTIFIER OFF;
GO

DROP TABLE PartitionSchemaNameGreaterThan64abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.PartitionTableNameGreaterThan128abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz
GO

DROP TABLE PartitionSchemaNameGreaterThan64abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.PartitionTableNameGreaterThan64AndLessThan128HavingEmoji😎$123🌍rder
GO

DROP SCHEMA PartitionSchemaNameGreaterThan64abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
GO
--------------------------------------------------
--- DROP Partition Scheme
--------------------------------------------------
DROP PARTITION SCHEME IntPartitionScheme
GO

DROP PARTITION SCHEME BigIntPartitionScheme
GO

DROP PARTITION SCHEME SmallIntPartitionScheme
GO

DROP PARTITION SCHEME TinyIntPartitionScheme
GO

DROP PARTITION SCHEME DecimalPartitionScheme
GO

DROP PARTITION SCHEME NumericPartitionScheme
GO

DROP PARTITION SCHEME MoneyPartitionScheme
GO

DROP PARTITION SCHEME SmallMoneyPartitionScheme
GO

DROP PARTITION SCHEME DatePartitionScheme
GO

DROP PARTITION SCHEME DateTimePartitionScheme
GO

DROP PARTITION SCHEME DateTime2PartitionScheme
GO

DROP PARTITION SCHEME SmallDateTimePartitionScheme
GO

DROP PARTITION SCHEME CharPartitionScheme
GO

DROP PARTITION SCHEME VarCharPartitionScheme
GO

DROP PARTITION SCHEME NVarCharPartitionScheme
GO

DROP PARTITION SCHEME NCharPartitionScheme
GO

DROP PARTITION SCHEME BinaryPartitionScheme
GO

DROP PARTITION SCHEME VarBinaryPartitionScheme
GO

DROP PARTITION SCHEME UniqueIdentifierPartitionScheme
GO

DROP PARTITION SCHEME PartitionSchemeNameGreaterThan64AndLessThan128abcdefghijklmnopqrstuvwxyz
GO

DROP PARTITION SCHEME PARTITION_SCHEMEログインαιώνια
GO

DROP PARTITION SCHEME [PARTITION_SCHEME  유니코드스키마👻  ]
GO

SET QUOTED_IDENTIFIER ON;
GO

DROP PARTITION SCHEME "PARTITION_SCHEME 😎$@ #123 🌍rder  "
Go

SET QUOTED_IDENTIFIER OFF;
GO

DROP PARTITION SCHEME PartitionSchemeNameGreaterThan64AndLessThan128HavingEmoji😎$123🌍rder
GO

-------------------------------------------
--- DROP Partition Function
-------------------------------------------
DROP PARTITION FUNCTION IntPartitionFunction 
GO

DROP PARTITION FUNCTION BigIntPartitionFunction 
GO

DROP PARTITION FUNCTION SmallIntPartitionFunction 
GO

DROP PARTITION FUNCTION TinyIntPartitionFunction 
GO

DROP PARTITION FUNCTION DecimalPartitionFunction 
GO

DROP PARTITION FUNCTION NumericPartitionFunction 
GO

DROP PARTITION FUNCTION MoneyPartitionFunction 
GO

DROP PARTITION FUNCTION SmallMoneyPartitionFunction 
GO

DROP PARTITION FUNCTION DatePartitionFunction 
GO

DROP PARTITION FUNCTION DateTimePartitionFunction 
GO

DROP PARTITION FUNCTION DateTime2PartitionFunction 
GO

DROP PARTITION FUNCTION SmallDateTimePartitionFunction 
GO

DROP PARTITION FUNCTION CharPartitionFunction 
GO

DROP PARTITION FUNCTION VarCharPartitionFunction 
GO

DROP PARTITION FUNCTION NVarCharPartitionFunction 
GO

DROP PARTITION FUNCTION NCharPartitionFunction 
GO

DROP PARTITION FUNCTION BinaryPartitionFunction 
GO

DROP PARTITION FUNCTION VarBinaryPartitionFunction 
GO

DROP PARTITION FUNCTION UniqueIdentifierPartitionFunction 
GO

DROP PARTITION FUNCTION PartitionFunctionNameGreaterThan64AndLessThan128abcdefghijklmnopqrstuvwxyz
GO

DROP PARTITION FUNCTION PartitionFunctionHavingDifferentCollationInput
GO

DROP PARTITION FUNCTION PARTITION_FUNCTIONログインαιώνια
GO

DROP PARTITION FUNCTION [PARTITION_FUNCTION  유니코드스키마👻  ]
GO

DROP PARTITION FUNCTION PartitionFunctionNameGreaterThan64AndLessThan128HavingEmoji😎$123🌍rder
GO

SET QUOTED_IDENTIFIER ON;
GO

DROP PARTITION FUNCTION "PARTITION_FUNCTION 😎$@ #123 🌍rder  "
Go

SET QUOTED_IDENTIFIER OFF;
GO